package Homework;

import java.util.ArrayList;
import java.util.List;

public class Demo01 {

	public static void main(String[] args) {
		int[] aa = {10,6,20,50,100,200,500,800,2,80,300,700};
		ArrayList<Integer> aw = new ArrayList<Integer>();
		Object lock = new Object();
		for(int i : aa){
			aw.add(i);
		}
		Box2 a = new Box2(aw,lock);
		Box2 b = new Box2(aw,lock);
		a.setName("box1");
		b.setName("box2");
		a.start();
		try {
			Thread.sleep(250);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		b.start();	
	}

}
